<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<header>
    <title>学生端登录</title>
    <script>
        function refreshVerifyCode() {
            //1获取验证码对象
            var vcode = document.getElementById("vcode");
            //2设置src属性
            vcode.src = "${pageContext.request.contextPath}/checkCodeServlet?time=" + new Date().getTime();
        }
    </script>
    <jsp:include page="header.jsp"></jsp:include>
</header>

<body>
<div class="container">
    <hr>
    <div class="row">
        <div class="col-xs-2 col-md-3"></div>
        <div class="col-xs-8 col-md-6">
            <form action="${pageContext.request.contextPath}/studentLoginServlet" method="post" class="form-horizontal">
                <br>
                <div class="row">
                    <input type="text" class="form-control input-lg" name="sid" placeholder="学号" maxlength="10">
                </div>
                <br>
                <div class="row">
                    <input type="password" class="form-control input-lg" name="pwd" placeholder="密码" maxlength="16">
                </div>
                <br>
                <div class="row">
                    <div class="col-xs-6 col-md-8" style="padding-left: 0px">
                        <input type="text" class="form-control input-lg" name="verifycode" placeholder="验证码">
                    </div>
                    <div class="col-xs-6  col-md-3">
                        <a href="javascript:refreshVerifyCode();">
                            <img id="vcode" src="${pageContext.request.contextPath}/checkCodeServlet" title="点击刷新">
                        </a>
                    </div>
                </div>
                <br>
                <div class="row">
                    <p class="bg-warning text-center " style="font-size: x-large">${requestScope.login_msg}</p>
                </div>
                <div class="row">
                    <button type="submit" class="btn btn-primary btn-lg btn-block" >登录</button>
                </div>
            </form>
            <div class="row">
                <a href="${pageContext.request.contextPath}/regist.jsp" type="button" class="btn btn-primary btn-lg btn-block">注册</a>
            </div>

            <br>
            <div class="row">
                <strong>其他人员：</strong>
                <span>
                    <a href="${pageContext.request.contextPath}/teacher/login" class="btn btn-default btn-lg" role="button">我是老师</a>
                </span>
                <span>
                    <a href="${pageContext.request.contextPath}/admin/login.jsp" class="btn btn-default btn-lg" role="button">我是管理员</a>
                </span>
            </div>
        </div>
    </div>
</div>
<jsp:include page="footer.jsp"></jsp:include>
</body>

</html>